package com.zz.parkingsystem.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 账户表
 * @TableName t_account
 */
@Data
public class Account implements Serializable {
    /**
     * 账户id
     */
    private Integer accId;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 订单数量
     */
    private Integer accOrderCount;

    /**
     * 绑定车辆数量
     */
    private Integer accCarsBound;

    /**
     * 消费金额
     */
    private BigDecimal accSpend;

    /**
     * 未支付金额
     */
    private BigDecimal accUnpaid;

    /**
     * 预留varchar字段
     */
    private String reservedVar;

    /**
     * 预留int字段
     */
    private Integer reservedInt;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Account other = (Account) that;
        return (this.getAccId() == null ? other.getAccId() == null : this.getAccId().equals(other.getAccId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getAccOrderCount() == null ? other.getAccOrderCount() == null : this.getAccOrderCount().equals(other.getAccOrderCount()))
            && (this.getAccCarsBound() == null ? other.getAccCarsBound() == null : this.getAccCarsBound().equals(other.getAccCarsBound()))
            && (this.getAccSpend() == null ? other.getAccSpend() == null : this.getAccSpend().equals(other.getAccSpend()))
            && (this.getAccUnpaid() == null ? other.getAccUnpaid() == null : this.getAccUnpaid().equals(other.getAccUnpaid()))
            && (this.getReservedVar() == null ? other.getReservedVar() == null : this.getReservedVar().equals(other.getReservedVar()))
            && (this.getReservedInt() == null ? other.getReservedInt() == null : this.getReservedInt().equals(other.getReservedInt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAccId() == null) ? 0 : getAccId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getAccOrderCount() == null) ? 0 : getAccOrderCount().hashCode());
        result = prime * result + ((getAccCarsBound() == null) ? 0 : getAccCarsBound().hashCode());
        result = prime * result + ((getAccSpend() == null) ? 0 : getAccSpend().hashCode());
        result = prime * result + ((getAccUnpaid() == null) ? 0 : getAccUnpaid().hashCode());
        result = prime * result + ((getReservedVar() == null) ? 0 : getReservedVar().hashCode());
        result = prime * result + ((getReservedInt() == null) ? 0 : getReservedInt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", accId=").append(accId);
        sb.append(", userId=").append(userId);
        sb.append(", accOrderCount=").append(accOrderCount);
        sb.append(", accCarsBound=").append(accCarsBound);
        sb.append(", accSpend=").append(accSpend);
        sb.append(", accUnpaid=").append(accUnpaid);
        sb.append(", reservedVar=").append(reservedVar);
        sb.append(", reservedInt=").append(reservedInt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}